<template>
<div>
  用户名：<input type="text" v-model="username">
</div>
</template>

<script>
export default {
  name: 'username',
  data(){
    return {
      username:''
    }
  },
  watch:{
    username(newData,oldData){
      this.$store.commit('SET_USERNAME',newData)
    }
  }
}
</script>

<style scoped>

</style>
